class Solution:
    def findMaxConsecutiveOnes(self, nums: list[int]) -> int:
        n = len(nums)
        sum = 0
        ans = 0
        for i in range(0, n):
            if nums[i] == 1:
                sum += 1
                ans = max(ans, sum)
            else:
                sum = 0
        print(ans)
        return ans






sol = Solution()

nums =[1,0,1,1,0,1]

sol.findMaxConsecutiveOnes(nums)